package com.dc.project.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dc.project.system.entity.SysPost;
import com.dc.project.system.entity.SysUserPost;

import java.util.List;

/**
 * 用户岗位关联表(SysUserPost)表数据库访问层
 *
 * @author zhuangcy
 * @since 2021-06-08 12:37:00
 */
public interface SysUserPostDao extends BaseMapper<SysUserPost> {

    /**
     * 查询所有数据
     *
     * @param sysUserPost
     * @return
     */
    List<SysUserPost> queryAll(SysUserPost sysUserPost);

    /**
     * 判断岗位是否被使用
     *
     * @param postId
     * @return
     */
    Integer existUser(Integer postId);

    /**
     * getUserPosts
     * @param userId
     * @return
     */
    List<SysPost> getUserPostsByUserId(Integer userId);
}